Field of the Invention
The present invention relates to an information processing apparatus, an information processing method, and a storage medium configured to store a computer program, for designating an area serving as a reference for extracting a document area extracted from an image and performing skew correction on the resultant document area.
Description of the Related Art
In recent years, mobile terminals having advanced information processing functions such as smartphones and tablet personal computers (PCs) have been widely used. These mobile terminals have a camera and thus have an image capturing function (camera function). Recently, image data representing an image of a document, which is a paper medium, captured with the camera function of the mobile terminal has been stored in a memory of the mobile terminal. Thus, the mobile terminal and a printer have been used in combination more frequently for copying a document. More specifically, image data obtained by capturing an image of the document is transmitted to the printer to be printed. All things considered, the user does not have to have a multifunction peripheral (MFP), having both scanner and printer functions, and only needs the mobile terminal and the printer to copy the document.
However, the image capturing of the document with the camera function of the mobile terminal is different from scanning with the MFP, and it is difficult to capture a frontal image of the document covering the entire captured image with no skew. More specifically, the distance and angel between the camera and the document are difficult to accurately maintain without fixing the mobile terminal and the document, which is a shooting object, by using a mount portion, a tripod, and the like. The captured image thus obtained might include an unwanted object other than the document area or might be geometrically skewed as a result of the image capturing in an oblique direction, and thus should not be directly copied or converted into a data file. Thus, before the captured image is copied or converted into a data file, only a document area needs to be cut out from the captured image to be subjected to skew correction (also referred to as keystone correction in some cases), so that geometrical skew will be corrected.
The document area can be cut out from the captured image, with a smallest possible processing load on the user, by using edge information in the captured image to automatically detect four sides of the document area. However, the automatic detection for the sides of the document area might end in a failure when edges of the sides of the document area cannot be detected due to a low contrast between the document area and a background area, when a correct edge cannot be detected because too many edges other than the four sides of the document area are detected, or in other like cases. Thus, a correct area needs to be designated with a correction operation received from the user, for positions of the four sides of a quadrilateral shape that is a first candidate of the document area displayed on an input image in an overlapping manner.
The quadrilateral area can be designated by the user through a method including setting a handler for the correction operation at each of the vertexes and the midpoint of each side of the quadrilateral shape and receiving the operation through a mouse and a touch operation. With this method, the user can move the vertex and the side to a desired position by operating the handler.
Furthermore, a method has been available in which the user does not directly designate the position of the vertex and the side but selects the position from among candidates that have been obtained by calculation in advance. In Japanese Patent Application Laid-Open No. 2005-303941, a contour is designated by obtaining a plurality of contour candidates, providing the contour candidates one by one in accordance with a key operation performed by the user performing switching among the contour candidates, and causing the user to determine a desired contour. As illustrated in FIG. 6 in Japanese Patent Application Laid-Open No. 2005-303941, the user selects the contour candidate, with one contour candidate, which is a current selection target based on the key operation for switching among the contour candidates, displayed in a bold line, and with all the other contour candidates displayed in dashed lines.
However, in Japanese Patent Application Laid-Open No. 2005-303941, all the contour candidate sides are displayed on an image when the key operation of switching among the contour candidates is performed. Thus, a convoluted image with extremely low visibility is displayed. Furthermore, it is difficult for the user to intuitively select a desired quadrilateral area through the key operation for the switching.
The present invention is directed to a technique in which a user can easily and efficiently designate each side of a quadrilateral area used as a reference for skew correction. More specifically, only when a user selects a side for which the user desires to change a position and an angle, a group of candidate lines is displayed for the selected side so that the user can select a desired side from the group of candidate lines in a displayed screen that is prevented from being convoluted.